package com.qingzhuge.common.lock;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 * @author : zero.xiao
 * @date :2019-03-23 09:50
 * @description :
 * @modified :
 * @since : 1.0.0
 */
public enum RWLock {
    /***/
    INSTANCE;
    private static final ReadWriteLock READWRITE = new ReentrantReadWriteLock();

    public Lock writeLock(){
        return READWRITE.writeLock();
    }

    public Lock readLock(){
        return READWRITE.readLock();
    }
}
